//

// 获取本地存储数据的函数
export const getItem = (key) => {
  const item = localStorage.getItem(key)
  try {
    return JSON.parse(item)
  } catch (e) {
    return false
  }
}

// 存储本地数据
export const setItem = (key, value) => {
  if (typeof value === 'object') {
    value = JSON.stringify(value)
  }
  return localStorage.setItem(key, value)
}

//  移除本地存储数据的函数
export const removeItem = (key) => localStorage.removeItem(key)
